package com.atguigu.design.pattern.v2;

import org.springframework.stereotype.Component;

/**
 * @Author: shenhao
 * @CreatTime: 2024/11/8 21:04
 * @Version: 1.0
 */
@Component
public class CocaHandlerV2 implements HandlerStrategyFactory{
    @Override
    public void getCoca(String parameter) {
        System.out.println("我是可口可乐-策略+工厂 "+parameter);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
                                                // k                //v
        Factory.registerStrategyFactory("Coca".toLowerCase(), this);
    }
}
